home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / comm / cnet / mfb.lha / MF.rexx < prev   
OS/2 REXX Batch file  |  1994-06-28  |  3KB  |  121 lines

  1. /* Multi-Feedback */
  2.  
  3. Options results ; signal on SYNTAX ; signal on ERROR ; signal on IOERR
  4. tr=transmit ; se=sendstring ; gu=getuser
  5.  
  6. if ~exists("pfiles:sysoplist") then signal CONFIG
  7.  
  8. se 'n1c6Want to leave feedback [Y/N]?'
  9. ASK:
  10. getchar ; yn=result
  11. if yn='n' | yn='N' then signal QUIT
  12. if yn='y' | yn='Y' then signal begin
  13. if yn="" then signal begin
  14. signal ASK
  15.  
  16. BEGIN:
  17. /* read in the names of the sysops */
  18. if ~exists("pfiles:sysoplist") then do
  19.   tr 'could not find sysop list!'
  20.   exit
  21. end
  22.   call open(sl,"pfiles:sysoplist","R")
  23.   howmany=readln(sl)
  24.   do x=1 to howmany
  25.     coacct.x=readln(sl)
  26.     coname.x=readln(sl)
  27.   end
  28.   call close(sl)
  29.  
  30. /* display them */
  31. se 'f1c6'
  32. tr '                        Multi-Feedback written by Vermithrax'
  33. tr '                               of Hell''s Furnace BBS!'
  34. tr '                                    405-789-0038'
  35. tr '     ----------------------------------------------------------------------'
  36. tr 'n1c7Who would you like to direct this feedback to?n1'
  37. do x=1 to howmany
  38.   tr coacct.x' 'coname.x
  39. end
  40. se 'n1c2Enter the account number of the recipient (0=quit/default=1): '
  41. query ; sendto=result
  42. if sendto="" then sendto=1
  43. if sendto="0" then signal quit
  44.  
  45. /* write the mail */
  46. cleareditor
  47. calleditor 50
  48. setmailsubj "Feedback"
  49. writemail sendto
  50. signal quit
  51.  
  52. CONFIG:
  53. tr 'n1c7Could not find config!  We need to set you up!'
  54. tr 'c4Press any key...g1'
  55. CONFIG3:
  56. tr 'f1c2Before we go on, you need to know the following items:'
  57. tr 'c31. How many co-sysops you wish to include'
  58. tr 'c42. All of your co-sysops account numbers'
  59. tr 'c53. Your co-sysops names/handles'
  60. tr 'n1c6If you don''t have this information, you can quit now and use the UI'
  61. tr 'command to get this information.'
  62. se 'n1c7Are you ready to continue? (Y/N) '
  63. CONFIG1:
  64. getchar ; cyn=result
  65. if cyn="y" | cyn="Y" then signal CONFIG2
  66. if cyn="n" | cyn="N" then signal QUIT
  67. signal CONFIG1
  68. CONFIG2:
  69. se 'f1n1c3How many co-sysops will be included in this list? (Include yourself!) '
  70. query ; chowmany=result
  71. do z=1 to chowmany
  72.   se 'Account number of co/sysop number 'z': '
  73.   query ; cacct.z=result
  74.   se 'Handle (or name) of co/sysop number 'z': '
  75.   query ; chan.z=result
  76. tr ' '
  77. end
  78.  
  79. call open(slw,"pfiles:sysoplist","W")
  80.   call writeln(slw,chowmany)
  81.   do a=1 to chowmany
  82.     call writeln(slw,cacct.a)
  83.     call writeln(slw,chan.a)
  84.   end
  85. call close(slw)
  86. if ~exists("pfiles:sysoplist") then do
  87.   tr 'could not find sysop list!'
  88.   exit
  89. end
  90.   call open(sl,"pfiles:sysoplist","R")
  91.   howmany=readln(sl)
  92.   do x=1 to howmany
  93.     coacct.x=readln(sl)
  94.     coname.x=readln(sl)
  95.   end
  96.   call close(sl)
  97. tr 'n1c6'
  98. do x=1 to howmany
  99.   tr coacct.x' 'coname.x
  100. end
  101. se 'n1c7Is this correct? (Y/N) '
  102. getchar ; cyn=result
  103. if cyn="y" | cyn="Y" then Signal CONFIG4
  104. if cyn="n" | cyn="N" then signal CONFIG3
  105. CONFIG4:
  106. tr 'c7n1Done!  Use the command again to test it!'
  107.  
  108.  
  109.  
  110.  
  111.  
  112. QUIT:
  113. tr ''
  114. EXIT
  115.  
  116. SYNTAX: ; ERROR: ; IOERR:
  117.     tr 'c1___________________________________________________________________'
  118.     tr 'n1c7'rc' ('errortext(rc)') in line 'sigl'.'
  119.     tr 'c1___________________________________________________________________n1'
  120.   bufferflush
  121. exit